gusucode.com > 忠网网站广告管理系统 ZonGG V1.3 > 忠网网站广告管理系统 ZonGG V1.3\code\GGtiaoQlx.asp

    <!-- #INCLUDE FILE="login.asp" -->
<head>
<meta http-equiv="Content-Language" content="zh-cn">
</head>

<%
if xmltype=1 then  response.redirect "GGtiaoQl.asp?id="&trim(request("id"))

	'///*********************************
	'   广告条清理程序  数据库存取类型使用
	'********************************///


	  action=trim(request("action"))
	  Dim dqw
	
	  dqw="清理ID为"&trim(request("id"))&"的广告条相关信息"&" [<a href=javascript:opw('GGtiaoCz.asp?a=Yl&id="&request.querystring("id")&"','ZonGG"&request.querystring("id")&"',800,600)>预览</a>]"
	  Call Heads_GGtiao(dqw)


if not isnumeric(trim(request("id"))) then
response.write "错误:广告条ID无效!"
response.end
else
id = trim(request("id"))
end if
	  
	  
	  
Rs1.open "select * from Advertisement where ADid="&id,conn,3,3,1
if not Rs1.eof then
ADid=Rs1(0)
ADname=Rs1(1)
ADintro=Rs1(2)
ADact=Rs1(3)
ADclass=Rs1(4)
Pids=Rs1(5)
Picid=Rs1(6)
ADurl=Rs1(7)
ADwindow=Rs1(8)
ADshow=Rs1(9)
ADshows=Rs1(10)
ADclick=Rs1(11)
ADclicks=Rs1(12)
ADtime=Rs1(13)
ADstoptime=Rs1(14)
ADstarttime=Rs1(15)
ADxslei=Rs1(16)
ADcss=Rs1(17)
Picurl=Rs1(18)
ADipkg=Rs1(19)
			
	
	
	if action="yes" then
			
			  if trim(request("sc"))<>"yes" then  ''如果 为非删除
			  
			  
			  	if trim(request("qkll"))="yes" then '' 清空浏览
				conn.execute "delete from ip1 where adid="&ADid
				qkllxs="->> 浏览IP记录被清空"&"<BR><BR>"		  	
			  	end if
			  	
			  	if trim(request("qkdj"))="yes" then '' 清空点击		  	
	    		conn.execute "delete from ip1 where adid="&ADid
	    		qkdjxs="->> 点击IP记录被清空"&"<BR><BR>"    				  	
			  	end if
			  	
			  	
			  	if trim(request("llcs"))="yes" then '' 如果选中浏览次数重置 则调入重置浏览输入数字
			  	
				  	if (PubIfzhengshu(trim(request("llcs1"))))="yes" then  '' 如果浏览次数重置数有效,则更新 ADshows
				  	Rs1(10) = trim(request("llcs1"))
				  	Rs1.update
				  	llcsxs="->> 点击次数被重置为 "&trim(request("llcs1"))&"<BR><BR>"
				  	else
				  	llcsxs="->> 点击次数重置数无效"&"<BR><BR>"
				  	end if		  	
			  	
			  	end if
			  	
			  	
			  	if trim(request("djcs"))="yes" then '' 如果选中点击次数重置 则调入重置点击输入数字
			  	
				  	if (PubIfzhengshu(trim(request("djcs1"))))="yes" then  '' 如果点击次数重置数有效,则更新 ADclicks
				  	Rs1(12) = trim(request("djcs1"))
				  	Rs1.update
				  	djcsxs="->> 点击次数被重置为 "&trim(request("djcs1"))&"<BR><BR>"
				  	else
				  	djcsxs="->> 点击次数重置数无效<BR><BR>"
				  	end if
			  	
			  	end if
			  
			  
				
				'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
				'' 如果  request("qcgl")  ="yes"  则 执行广告位关联取消操作
				'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
				if trim(request("qcgl"))="yes" then
				pidss=trim(request("pids"))
				
				  if pidss<>"" then
				  
				  pidsxs="->> 取消了跟ID为 "&pids&" 广告位的关联<BR><BR>"
					 	
					'' 将广告ID循环从选中的各广告位移出,同时将选中的广告位ID从 Pids 中移出
					Dim xhggws1,ggws1
					
					xhggws1=split(pidss&",",",")
					
					for i=0 to Ubound(xhggws1)-1
					
					if isnumeric(xhggws1(i)) then
		
					  rs.open "select ADids,Pname from place where Pid="&cint(xhggws1(i)),conn,3,3,1
					   
					   if instr(rs(0),",")>0 then
					    if instr(rs(0),ADid&",")>0 then
					     rs(0)=replace(rs(0),ADid&",","")
					     rs.update
					    else
					     rs(0)=replace(rs(0),","&ADid,"")
					     rs.update
					    end if
					   else
					     rs(0)=""
					     rs.update
					   end if
					
					  rs.close
					  
			
				
					 '' 清除 Pids 中的选中广告位 id xhggws1(i) 得到最后更新的 Pids
				 
					 if instr(Pids,",")>0 then
					    if instr(Pids,xhggws1(i)&",")>0 then
					     Pids=replace(Pids,xhggws1(i)&",","")
					    else
					     Pids=replace(Pids,","&xhggws1(i),"")			     
					    end if
					   else
					     Pids=""			     
					 end if
					   				  						   
					'''''''
					  
					 end if				
					next	
					
					 '' 新 Pids 入仓				 
					 conn.execute("update Advertisement set Pids='"&Pids&"' where Adid="&ADid)				
				  	Rs1(5) = Pids
				  	Rs1.update
					 
					 
				 end if
						
			   end if
			 
			 response.write "<b>保留当前广告条基本信息,并对其进行了如下清理:</b><BR><BR>"&qkllxs&llcsxs&qkdjxs&djcsxs&pidsxs
			 
			 
			 else  '' 如果 为删除
 
			 
			 	conn.execute("delete from Advertisement where ADid="&ADid)	 	
			 	
			 	''
			 	'' 如果  pids<>""  执行广告位关联取消操作
			 	''
			 	
			    if Pids<>"" then
				  
				  pidsxs="->> 取消了跟ID为 "&pids&" 广告位的关联<BR><BR>"
					 	
					'' 将广告ID循环从选中的各广告位移出,同时将选中的广告位ID从 Pids 中移出
					'' Dim xhggws1,ggws1
					
					xhggws1=split(Pids&",",",")
					
					for i=0 to Ubound(xhggws1)-1
					
					if isnumeric(xhggws1(i)) then
					
					  rs.open "select ADids,Pname from place where Pid="&cint(xhggws1(i)),conn,3,3,1
					   
					   if instr(rs(0),",")>0 then
					    if instr(rs(0),ADid&",")>0 then
					     rs(0)=replace(rs(0),ADid&",","")
					     rs.update
					    else
					     rs(0)=replace(rs(0),","&ADid,"")
					     rs.update
					    end if
					   else
					     rs(0)=""
					     rs.update
					   end if
					     
					  rs.close			  
	
					 end if				
					next	
				 end if
			   response.write "<b>成功删除了当前广告条,并对其进行了如下清理:</b><BR><BR>->> 浏览IP记录被清空<BR><BR>->> 点击IP记录被清空<BR><BR>->>  取消了跟ID为 "&pids&" 广告位的关联<BR><BR>"

			   
			 end if	
				
			
			response.write "[<a href='GGtiao.asp?'>返回列表</a>] [<a href='GGtiaoQlx.asp?id="&ADid&"'>再次清理</a>]"
			
	
	else '' 	
			
			%><div align="center">
				<table width="580" id="table1"  border=1 cellspacing=0 cellpadding=2 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF bgcolor=#ffffff>
				<form method="POST" action="?action=yes&id=<%=ADid%>"><tr>
					<td align="center" height="30"><input type="radio" value="yes" name="sc">删除广告条&nbsp; 
						<input type="radio" value="no" checked name="sc">保留广告条</td>
				</tr>
				<tr>
					<td align="center"  class="td1">选中“删除广告条”时,以下操作无效,并自动删除与之相关的所有信息(包含IP记录和与广告位的关联)</td>
				</tr>
				<tr>
					<td><br>
						<p>
						<input type="checkbox" name="qkll" value="yes">清空浏览IP记录&nbsp;&nbsp; 
						<input type="checkbox" name="llcs" value="yes">浏览次数重置为:
						<input type="text" name="llcs1" size="5" value="<%=ADshows%>"> <i>必须为正整数</i></p>
						<p><input type="checkbox" name="qkdj" value="yes">清空点击IP记录&nbsp;&nbsp; 
						<input type="checkbox" name="djcs" value="yes">点击次数重置为:
						<input type="text" name="djcs1" size="5" value="<%=ADclicks%>"> <i>必须为正整数</i></p>
						<p><input type="checkbox" name="qcgl" value="yes">清除该广告条与下列选中广告位的关联</p>
				
						
						
				<%	  dim places
			          if Trim(Pids)<>"" then
			          places=split(Pids&",",",")
			          For i=0 To Ubound(places)-1
			          response.write "&nbsp; &nbsp; <input type='checkbox' name='pids' value='"&places(i)&"'><font class=red> "&i+1&". </font>"&Ggwm(places(i))&"&nbsp; <font class=red>ID="&places(i)&"</font><br> "          
			          next
			          end if
			        %>	
						
			 </td>
				</tr>
				<tr>
					<td height="30">
					<p align="center"><input type="submit" value="执行清理" name="B1"></td>
				</tr>
				<tr>
					<td align="center">
				</td>
				</tr></form>
			</table>
			</div>
			
<%		end if
	
	'''''''''''''
end if
Rs1.close
		    
	 
			
	call close_conn()
		 
%>